package com.hmall.mapper;

import com.hmall.model.SysCustomer;
import com.hmall.util.MyMapper;
import com.hmall.vo.MyCustomerVo;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface SysCustomerMapper extends MyMapper<SysCustomer> {
    List<SysCustomer> selectByDeptId(@Param("dept_id") Integer dept_id);

    Integer checkBusName(@Param("bus_name") String bus_name);

    Integer selectDeptIdByCustomerId(@Param("customer_id") Integer customer_id);

    Integer selectCustomerByName(@Param("bus_name") String bus_name);

    List<SysCustomer> selectByDeptIdAndSearch(@Param("dept_id") Integer dept_id,@Param("search") String search);

    String selectSalesManName(@Param("customer_id") Integer customer_id);

    List<SysCustomer> selectByDeptIdAndUserId(@Param("dept_id") Integer dept_id,@Param("user_id") Integer user_id);

    List<SysCustomer> selectByDeptIdAndSearchAndUserId(@Param("dept_id") Integer dept_id,@Param("search") String search,@Param("user_id") Integer user_id);

    Integer selectCustomerId(@Param("user_id")Integer user_id);

    List<MyCustomerVo> selectMyCustomer(@Param("user_id") Integer user_id);

    List<MyCustomerVo> selectDealerCustomer(@Param("dealer_id") Integer dealer_id);

    Integer selectCustomerUserId(@Param("customer_id") Integer customer_id);

    List<MyCustomerVo> selectCustomer();

    Integer selectByDeptIdAndTime(@Param("dept_id") Integer dept_id,@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    Integer selectByTime(@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    List<MyCustomerVo> getCustomerList();

    List<SysCustomer> selectByQuery(@Param("query") String query);

    Integer selectSalesManId(@Param("userId") Integer userId);

    List<SysCustomer> selectXBiao1(@Param("dealer_id") Integer dealer_id,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
}